<template>
	<el-dialog title="预览" v-model="previewDialogVisible" width="70%">
		<PageComponent style="height: 70vh;overflow: auto;" ref="pageComponent"></PageComponent>
	</el-dialog>
</template>

<script>
	import PageComponent from '@/components/PageComponent.vue';
	export default {
		name: "previewDialog",
		components: {
			PageComponent
		},
		data() {
			return {
				previewDialogVisible: false,
			}
		},
		provide() {
			return {
				children: []
			}
		},
		methods: {
			setVisible(visible) {
				this.previewDialogVisible = visible;
				if (visible) {
					this.$nextTick(function() {
							this.loadPage();
						});
					}
				},
				loadPage() {
					var pageCode = this.$store.state.formDesigner.getCreateContext().pageCode;
					this.$refs.pageComponent.navigatePage(pageCode, {},false);
				}
			},
		}
</script>

<style>
</style>
